package lumis.service.wsrp.producer;

import lumis.doui.source.IDataProvider;
import lumis.doui.source.ISourceData;
import lumis.doui.source.TabularData;
import lumis.doui.source.TabularSource;
import lumis.doui.source.field.ITabularSourceField;
import lumis.portal.PortalException;
import lumis.portal.authentication.SessionConfig;
import lumis.service.wsrp.common.WSRPUtils;
import lumis.util.ITransaction;
/**
/**
 * {@link IDataProvider} responsible for populating a {@link TabularData} with
 * the possible WSRP windowStates to be selected on screen.
 * 
 * @version $Revision: 13092 $ $Date: 2011-05-28 18:19:06 -0300 (Sat, 28 May 2011) $
 * @since 6.0.0
 */
public class WindowStatesDataProvider implements IDataProvider<TabularSource<ITabularSourceField>>
{
	/** 
	 * {@inheritDoc}
	 */
	public void loadData(SessionConfig sessionConfig, TabularSource<ITabularSourceField> source, ITransaction transaction) throws PortalException
	{

		for (String state : WSRPUtils.WSRP_WINDOWS_STATES)
		{
			ISourceData row = source.getData().addRow();
			row.put("friendlyName", state);
			row.put("stateName", state);
		}
	}
}
